﻿namespace HamcoWcs.Service.Common.Encryptions.Extension
{
    public static class EncrypExtension
    {
        public static string ToDESEncrypt(this string s, string key)
        {
            return EncryptHelper.DESEncrypt(s, key);
        }
        public static string ToDESDecrypt(this string s, string key)
        {
            return EncryptHelper.DESDecrypt(s, key);
        }
        public static string ToAESEncrypt(this string s, string key)
        {
            return EncryptHelper.AESEncrypt(s, key);
        }
        public static string ToAESDecrypt(this string s, string key)
        {
            return EncryptHelper.AESDecrypt(s, key);
        }
        public static string ToRSAEncrypt(this string s, string publicKey, int keySize = 2048)
        {
            return EncryptHelper.RSAEncrypt(s, publicKey, keySize);
        }
        public static string ToRSADecrypt(this string s, string privateKey, int keySize = 2048)
        {
            return EncryptHelper.RSADecrypt(s, privateKey, keySize);
        }
        public static string ToMD5Encrypt(this string s)
        {
            return EncryptHelper.MD5Encrypt(s);
        }
        public static bool ToMD5Compare(this string s, string hash)
        {
            return EncryptHelper.MD5Compare(s, hash);
        }

    }
}
